<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let a = 0, b = 0;
        function fn(a) {
            fn = function fn2(b) {
                // alert(++a + b);
                console.log(++a + b);
            }
            // alert(a++);
            console.log(a++);
        }
        console.log(fn,'第一个');
        fn(1); //1
        console.log(fn,'第二个');
        fn(2);//5


        async function async1() {
            console.log('async1 start')
            await new Promise(resolve => {
                console.log('promise1')
            })
            console.log('async1 success')
            return 'async1 end'
        }
        console.log('srcipt start')
        async1().then(res => console.log(res))
        console.log('srcipt end')
        // 结果 srcipt start async1 start promise1 srcipt end
    </script>
</body>

</html>